package com.Sdebruijn.curriculumvitae.models;

import android.os.Parcelable;

import com.google.gson.annotations.SerializedName;
import com.j256.ormlite.field.DatabaseField;

/**
 * Abstract class representing both my {@link Work} and {@link Education}.
 * 
 * @author Stefan de Bruijn
 */
public abstract class Experience implements Parcelable{

	Experience() {
		// all persisted classes must define a no-arg constructor with at least
		// package visibility
	}

	/**
	 * id for the ORMLite-SQLite database
	 */
	@DatabaseField(id = true)
	@SerializedName("id")
	public int id;

	/**
	 * {@link String} representing either the earned title of the
	 * {@link Education} or the job title of the {@link Work}
	 */
	@DatabaseField
	@SerializedName("title")
	public String title;

	/**
	 * {@link Boolean} indicating whether this experience is still active
	 */
	@DatabaseField
	@SerializedName("current")
	public boolean current;

	/**
	 * The start date of my Experience. JSON fails to provide a proper way to
	 * indicate a point in time, thus using a String
	 */
	@DatabaseField
	@SerializedName("start_date")
	public String start_date;

	/**
	 * The end date of my {@link Experience}. JSON fails to provide a proper way
	 * to indicate a point in time, thus using a String
	 */
	@DatabaseField
	@SerializedName("end_date")
	public String end_date;

	/**
	 * {@link Institution} representing the school or company providing me this
	 * {@link Experience}
	 */
	@DatabaseField(foreign = true, foreignAutoCreate = true, foreignAutoRefresh = true)
	@SerializedName("institution")
	public Institution institution;

}